﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TSites.Core.Domain.MenuMgmt
{
    public class Menu:DomainObject<int>
    {
        public virtual string MenuName { get; set; }
        public virtual string MenuUrl { get; set; }
        public virtual int ModuleDetailId { get; set; }
        public virtual string MenuDescription { get; set; }
        public virtual string MessageCode { get; set; }
        public virtual int OrderNumber { get; set; }
        public virtual int ParentMenuId { get; set; }
        public virtual string CreateUserId { get; set; }
        public virtual DateTime? CreateDate { get; set; }
        public virtual string UpdateUserId { get; set; }
        public virtual DateTime? UpdateDate { get; set; }

        public virtual string ModuleId { get; set; }
        public virtual IList<Menu> SubMenus { get; set; }
        public virtual bool IsLeaf
        {
            get 
            {
                return (SubMenus == null || SubMenus.Count == 0); 
            }
        }
    }
}
